<?php

declare(strict_types=1);

namespace App\CustHub\Controller;

use App\CustHub\Annotation\SaasVerifySignature;
use App\CustHub\Service\RestService;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;
use Mine\MineController;

#[Controller('rest'),SaasVerifySignature]
class RestController extends MineController
{
    #[Inject]
    protected RestService $service;

    /**
     * @return \Psr\Http\Message\ResponseInterface
     * @throws \Psr\Container\ContainerExceptionInterface
     * @throws \Psr\Container\NotFoundExceptionInterface
     * @throws \RedisException
     */
    #[PostMapping('saveUser')]
    public function saveUser(): \Psr\Http\Message\ResponseInterface
    {
        $this->service->saveUser($this->request->all());
        return $this->success();
    }
}